<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jstl/core">
    
    <c:if test="${empty theme}">
        <c:set var="theme" value="default"/>
    </c:if>
    
    <c:if test="${theme == 'trans'}">
        <c:set var="round" value="false"/>
    </c:if>
    
    <c:if test="${empty small}">
        <c:set var="small" value="${false}" />
    </c:if>
    
    <c:if test="${empty round}">
        <c:set var="round" value="${true}" />
    </c:if>
    
    <c:if test="${empty class}">
        <c:set var="class" value="" />
    </c:if>
    
    <c:if test="${empty style}">
        <c:set var="style" value="" />
    </c:if>
    
    <c:choose>
        <c:when test="${not empty bordersize and bordersize != '0px'}">
            <c:set var="borderstyle" value="_b"/>            
        </c:when>
        <c:otherwise>
            <c:set var="bordersize" value="0px"/>
            <c:set var="borderstyle" value=""/>
        </c:otherwise>
    </c:choose>
    
    <c:choose>
        <c:when test="${not empty title and title != ''}">
            <c:set var="titlestyle" value="bgcolor_${theme}_b"/>            
        </c:when>
        <c:otherwise>
            <c:set var="titlestyle" value="fgcolor_${theme}"/>
        </c:otherwise>
    </c:choose>
    
    <div class="rframe fgcolor_${theme} border_${theme}" style="border-width: ${bordersize};">
        <c:if test="${round}">
            <b class="rtop bgcolor_${theme}${borderstyle}">
                <c:choose>
                    <c:when test="${small}">
                        <b class="rs1 ${titlestyle}"></b> 
                        <b class="rs2 ${titlestyle}"></b>
                    </c:when>
                    <c:otherwise>
                        <b class="r1 ${titlestyle}"></b> 
                        <b class="r2 ${titlestyle}"></b>
                        <b class="r3 ${titlestyle}"></b> 
                        <b class="r4 ${titlestyle}"></b>
                    </c:otherwise>                
                </c:choose>
            </b>
        </c:if>
        <c:if test="${not empty title and title != ''}">
            <div class="title_${theme} ${titlestyle} rtitle">
                ${title}
            </div>
        </c:if>
        <div class="rdiv_${theme} ${class}" style="${style}">
            <ui:insert />
        </div>
        <c:if test="${round}">
            <b class="rbottom bgcolor_${theme}${borderstyle}">
                <c:choose>            
                    <c:when test="${small}">
                        <b class="rs2 fgcolor_${theme}"></b> 
                        <b class="rs1 fgcolor_${theme}"></b>
                    </c:when>
                    <c:otherwise>                
                        <b class="r4 fgcolor_${theme}"></b> 
                        <b class="r3 fgcolor_${theme}"></b> 
                        <b class="r2 fgcolor_${theme}"></b> 
                        <b class="r1 fgcolor_${theme}"></b>                    
                    </c:otherwise>            
                </c:choose>
            </b>
        </c:if>
    </div>
</ui:composition>